/**
 * 作者:李杰
 * email: maillijie@gmail.com
 */
package com.javainfo.entity;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

@Entity
public class User {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Integer id;
	private String userAccount;
	private String userName;
	private String passwd;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sectionId")
	private Section section;

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	private Set<UserGroup> userGroups;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	private Set<Article> articles;

	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	private Set<SubArticle> subArticles;
	
	@ManyToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "categoryAdminId")
	private Set<ArticleCategory> manageCategorys;
	
	@OneToMany(fetch = FetchType.LAZY)
	@JoinColumn(name = "userId")
	private Set<Attachments> attachmentsSet;
	
	////////////////////////////////////////////////////////////////
	////////////////////////////////////////////////////////////////
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUserAccount() {
		return userAccount;
	}

	public void setUserAccount(String userAccount) {
		this.userAccount = userAccount;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPasswd() {
		return passwd;
	}

	public void setPasswd(String passwd) {
		this.passwd = passwd;
	}

	public Section getSection() {
		return section;
	}

	public void setSection(Section section) {
		this.section = section;
	}

	public Set<Article> getArticles() {
		return articles;
	}

	public void setArticles(Set<Article> articles) {
		this.articles = articles;
	}

	public Set<SubArticle> getSubArticles() {
		return subArticles;
	}

	public void setSubArticles(Set<SubArticle> subArticles) {
		this.subArticles = subArticles;
	}

	public Set<UserGroup> getUserGroups() {
		return userGroups;
	}

	public void setUserGroups(Set<UserGroup> userGroups) {
		this.userGroups = userGroups;
	}

	public Set<ArticleCategory> getManageCategorys() {
		return manageCategorys;
	}

	public void setManageCategorys(Set<ArticleCategory> manageCategorys) {
		this.manageCategorys = manageCategorys;
	}

	public Set<Attachments> getAttachmentsSet() {
		return attachmentsSet;
	}

	public void setAttachmentsSet(Set<Attachments> attachmentsSet) {
		this.attachmentsSet = attachmentsSet;
	}
}
